// pages/activity-detail/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    show: false,
    flag: false,
    actions: [
      {
        name: '问卷',
      },
      {
        name: '投票',
      },
      {
        name: '随机选人',
      },
    ],
    time: 30 * 60 * 60 * 6 * 1000,
    timeData: {},
    // 跳转后 choose 对应内容
    choose: 0,
    active: 0,
    steps: [
      {
        text: '报名',
        inactiveIcon: 'location-o',

      },
      {
        text: '签到',
        inactiveIcon: 'star-o',
        activeIcon: 'plus',
      },
      {
        inactiveIcon: 'clock-o',
        activeIcon: 'fail',
        text: '结束',
      },

    ],
    active_message:
      [
        {
          title: "文化艺术",
          image: "https://i0.hdslb.com/bfs/album/f6a344559e93eb448eacd9a0853a232eb9d66901.jpg",
          introduction: "信息系'守护青春','晴朗校园' '百城千校' 反诈安全课进入校园活动",
          time: "2021.09.25-2021.09.28",
          situation_people: "不限人数",
          startOrNot: "未开始",
          choose: 1,
        },
        {
          title: "身心健康",
          image: "https://i0.hdslb.com/bfs/album/357f717bdc0a1aac69a32867d4061ba1012db4c3.png",
          introduction: "防骗记心里,平安校园行,反诈校园卡片制作",
          time: "2021.08.15-2021.08.22",
          situation_people: "不限人数",
          startOrNot: "未开始",
          choose: 2
        },
        {
          title: "身心健康",
          image: "https://i0.hdslb.com/bfs/album/357f717bdc0a1aac69a32867d4061ba1012db4c3.png",
          introduction: "2021温州职业技术学院反诈活动",
          time: "2021.09.21-2021.09.25",
          situation_people: "不限人数",
          startOrNot: "未开始",
          choose: 3,
        },
        {
          title: "文化艺术",
          image: "https://i0.hdslb.com/bfs/album/6bf6581ba7f3069f62fd1624fd293f00940a447c.jpg",
          introduction: "会计2001反邪反毒反诈骗主题班会",
          time: "2021.09.28-2021.10.5",
          situation_people: "不限人数",
          startOrNot: "未开始",
          choose: 4,
        },
      ],
  },
  onLoad(options) {
    this.setData({
      choose: options.choose
    })
  },
  onShow() {
    this.setData({
      show: false
    })
  },
  onClose() {
    this.setData({ show: false });
  },

  onSelect(event) {
    this.setData({ show: false });
    console.log("event.detail", event.detail);
    var part_name = event.detail.name;
    wx.navigateTo({
      url: '/pages/teacher-make-activity/index?part_name=' + part_name,
      success: (result) => {

      },
    });
  },


  onChange1(e) {
    this.setData({
      timeData: e.detail,
    });
  },

  showActionSheet(e) {
    console.log(this.data.flag)
    if (this.data.flag === false) {
      this.setData({
        show: true,

      });

    }

    console.log("show=true")
  }
})